package cn.micai.base.lambda;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 描述：Java – How to convert String to Char Array
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/6/22 19:33
 */
public class StringToCharArrayExample {

    public static void main(String [] args) {


        // Java – How to convert String to Char Array

        String password = "password123";
        /*char[] chars = password.toCharArray();
        for (char temp : chars) {
            System.out.println(temp);
        }*/

        // Java 8 – Convert String to Stream Char

        password.chars()
                .mapToObj(x -> (char) x)
                .forEach(x->System.out.println(x));




    }
}
